#ifdef WWWPAL
#include "HTRobMan.h"
#include "XGMML_DTD.h"

PRIVATE const char* entities[XGMML_ENTITIES]= {
  	"\306",	/* capital AE diphthong (ligature) */ 
  	"\301",	/* capital A, acute accent */ 
  	"\302",	/* capital A, circumflex accent */ 
  	"\300",	/* capital A, grave accent */ 
  	"\305",	/* capital A, ring */ 
  	"\303",	/* capital A, tilde */ 
  	"\304",	/* capital A, dieresis or umlaut mark */ 
  	"\307",	/* capital C, cedilla */ 
  	"\320",	/* capital Eth, Icelandic */ 
  	"\311",	/* capital E, acute accent */ 
  	"\312",	/* capital E, circumflex accent */ 
  	"\310",	/* capital E, grave accent */ 
  	"\313",	/* capital E, dieresis or umlaut mark */ 
  	"\315",	/* capital I, acute accent */ 
  	"\316",	/* capital I, circumflex accent */ 
  	"\314",	/* capital I, grave accent */ 
  	"\317",	/* capital I, dieresis or umlaut mark */ 
  	"\321",	/* capital N, tilde */ 
  	"\323",	/* capital O, acute accent */ 
  	"\324",	/* capital O, circumflex accent */ 
  	"\322",	/* capital O, grave accent */ 
  	"\330",	/* capital O, slash */ 
  	"\325",	/* capital O, tilde */ 
  	"\326",	/* capital O, dieresis or umlaut mark */ 
  	"\336",	/* capital THORN, Icelandic */ 
  	"\332",	/* capital U, acute accent */ 
  	"\333",	/* capital U, circumflex accent */ 
  	"\331",	/* capital U, grave accent */ 
  	"\334",	/* capital U, dieresis or umlaut mark */ 
  	"\335",	/* capital Y, acute accent */ 
  	"\341",	/* small a, acute accent */ 
  	"\342",	/* small a, circumflex accent */ 
  	"\346",	/* small ae diphthong (ligature) */ 
  	"\340",	/* small a, grave accent */ 
  	"\046",	/* ampersand */ 
  	"\345",	/* small a, ring */ 
  	"\343",	/* small a, tilde */ 
  	"\344",	/* small a, dieresis or umlaut mark */ 
  	"\347",	/* small c, cedilla */ 
  	"\351",	/* small e, acute accent */ 
  	"\352",	/* small e, circumflex accent */ 
  	"\350",	/* small e, grave accent */ 
  	"\360",	/* small eth, Icelandic */ 
  	"\353",	/* small e, dieresis or umlaut mark */ 
  	"\076",	/* greater than */ 
  	"\355",	/* small i, acute accent */ 
  	"\356",	/* small i, circumflex accent */ 
  	"\354",	/* small i, grave accent */ 
  	"\357",	/* small i, dieresis or umlaut mark */ 
  	"\074",	/* less than */ 
	"\040", /* non-breaking space */
  	"\361",	/* small n, tilde */ 
  	"\363",	/* small o, acute accent */ 
  	"\364",	/* small o, circumflex accent */ 
  	"\362",	/* small o, grave accent */ 
  	"\370",	/* small o, slash */ 
  	"\365",	/* small o, tilde */ 
  	"\366",	/* small o, dieresis or umlaut mark */ 
        "\042", /* double quote sign - June 94 */
  	"\337",	/* small sharp s, German (sz ligature) */ 
  	"\376",	/* small thorn, Icelandic */ 
  	"\372",	/* small u, acute accent */ 
  	"\373",	/* small u, circumflex accent */ 
  	"\371",	/* small u, grave accent */ 
  	"\374",	/* small u, dieresis or umlaut mark */ 
  	"\375",	/* small y, acute accent */ 
  	"\377",	/* small y, dieresis or umlaut mark */ 
};

PRIVATE HTAttr no_attr[1] = 
	{{ 0 }};

PRIVATE HTAttr att_attr[XGMML_ATT_ATTRIBUTES+1] = {	
	{ "id" },
	{ "name" },
	{ "label" },
	{ "labelanchor" },
	{ "value" },
	{ "type" },
	{ 0 }	/* Terminate list */
};	

PRIVATE HTAttr center_attr[XGMML_CENTER_ATTRIBUTES+1] = {	
	{ "x" },
	{ "y" },
	{ "z" },
	{ 0 }	/* Terminate list */
};	

PRIVATE HTAttr edge_attr[XGMML_EDGE_ATTRIBUTES+1] = {	
	{ "id" },
	{ "name" },
	{ "label" },
	{ "labelanchor" },
	{ "source" },
	{ "target" },
	{ "weight" },
	{ 0 }	/* Terminate list */
};	

PRIVATE HTAttr graph_attr[XGMML_GRAPH_ATTRIBUTES+1] = {	
	{ "id" },
	{ "name" },
	{ "label" },
	{ "labelanchor" },
	{ "directed" },
	{ "Vendor" },
	{ "Scale" },
	{ "Rootnode" },
	{ "Graphic" },
	{ 0 }	/* TERMINATE LIST */
};	

PRIVATE HTAttr graphics_attr[XGMML_GRAPHICS_ATTRIBUTES+1] = {	
	{ "x" },
	{ "Y" },
	{ "z" },
	{ "w" },
	{ "h" },
	{ "d" },
	{ "image" },
	{ "bitmap" },
	{ "width" },	
	{ "arrow" },
	{ "capstyle" },
	{ "joinstyle" },
	{ "smooth" },
	{ "splinesteps" },
	{ "justify" },	
	{ "font" },
	{ "background" },
	{ "foreground" },
	{ "extent" },
	{ "start" },
	{ "style" },
	{ "stipple" },
	{ "visible" },
	{ "fill" },
	{ "outline" },
	{ "anchor" },
	{ 0 }	/* Terminate list */
};	

PRIVATE HTAttr node_attr[XGMML_NODE_ATTRIBUTES+1] = {	
	{ "id" },
	{ "name" },
	{ "label" },
	{ "labelanchor" },
	{ "edgeanchor" },
	{ "weight" },
	{ 0 }	/* Terminate list */
};	

PRIVATE HTAttr point_attr[XGMML_POINT_ATTRIBUTES+1] = {	
	{ "x" },
	{ "y" },
	{ "z" },
	{ 0 }	/* Terminate list */
};	


/*
**	ELEMENTS
**	Must match definitions in XGMML_DTD.html!
**	Must be in alphabetical order.
**
**    Name, 	Attributes, 		content
*/
PRIVATE HTTag tags[XGMML_ELEMENTS] = {
    { "att"	, att_attr,        XGMML_ATT_ATTRIBUTES,     SGML_EMPTY },
    { "center"  , center_attr,    XGMML_CENTER_ATTRIBUTES,   SGML_EMPTY },
    { "edge"  , edge_attr,      XGMML_EDGE_ATTRIBUTES,	     SGML_MIXED },
    { "graph"  , graph_attr,     XGMML_GRAPH_ATTRIBUTES,     SGML_MIXED },
    { "graphics"  , graphics_attr, XGMML_GRAPHICS_ATTRIBUTES,SGML_MIXED },
    { "line"  , no_attr,     XGMML_LINE_ATTRIBUTES,	     SGML_EMPTY },
    { "node"  , node_attr,     XGMML_NODE_ATTRIBUTES,	     SGML_MIXED },
    { "point"  , point_attr,     XGMML_POINT_ATTRIBUTES,     SGML_EMPTY },
};

PRIVATE SGML_dtd XGMMLP_dtd = {
    tags,
    XGMML_ELEMENTS,
    entities,
    sizeof(entities)/sizeof(char**)
};

PRIVATE SGML_dtd * DTD = &XGMMLP_dtd;

PUBLIC SGML_dtd * XGMML_dtd (void)
{
    return DTD;
}

PUBLIC BOOL XGMML_setDtd (const SGML_dtd * dtd)
{
    if (dtd) {
	DTD = (SGML_dtd *) dtd;
	return YES;
    }
    return NO;
}
#endif



